package kz.simplex.photobox.action;

import kz.simplex.photobox.model.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("accessList")
public class AccessList extends EntityQuery<Access> {

	private static final String EJBQL = "select access from Access access";

	private static final String[] RESTRICTIONS = {
			"lower(access.access) like lower(concat(#{accessList.access.access},'%'))",
			"lower(access.description) like lower(concat(#{accessList.access.description},'%'))",};

	private Access access = new Access();

	public AccessList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Access getAccess() {
		return access;
	}
}
